import classNames from 'classnames';
import './style.less';

interface IconBaseProps {
  className?: string;
  size?: number;
}

interface IconLinkProps extends IconBaseProps {
  href: string;
}

function Icon({ className, size = 16 }: IconBaseProps) {
  return (
    <i
      className={classNames('iconfont', className)}
      style={{
        fontSize: `${size}px`,
      }}
    />
  );
}

export function Icon_Github({ className, href }: IconLinkProps) {
  return (
    <a href={href} target="_blank" rel="noreferrer" title="github address">
      <Icon className={classNames('github', className)} size={30} />
    </a>
  );
}

export default Icon;
